package ar.org.cfired.creditos.sbsa;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import ar.org.cfired.hibernate.utils.HibernateUtil;

public class PruebaAsociacion {
	public static void main (String args[]) {
		Session session = null;
		session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction(); 
		AsociacionJbpmSBSA aso;
		Query q = session.createQuery("from ar.org.cfired.creditos.sbsa.AsociacionJbpmSBSA where Tipo='P' and Creditos=" + 4820);
		
		List<AsociacionJbpmSBSA> rta = q.list();
		System.out.println(rta.size());
		for (int i = 0; i<rta.size(); i++) {
			aso = rta.get(i);
			if (aso != null)
				System.out.println(aso.getSB()  );
		}
		
		aso = new AsociacionJbpmSBSA();
	}

}
